﻿@model Wabo.Dal.User

@{
    ViewBag.Title = Messages.CreateNewUser;
}

@using (Html.BeginForm("Create", "User", FormMethod.Post, new { @class = "form-horizontal" }))
{
    <fieldset>
        <legend>
            @Messages.CreateNewUser
        </legend>            
        
        @if (ViewBag.SystemSettings.enable_active_directory_login)
        {
            <div class="control-group">
                @Html.LabelFor(x => x.domain, new { @class = "control-label" })
                <div class="controls">
                    @Html.TextBoxFor(x => x.domain)
                </div>            
            </div>
            
        }
        <div class="control-group">
            @Html.LabelFor(x => x.username, new { @class = "control-label" })
            <div class="controls">
                @Html.TextBoxFor(x => x.username)        
                @Html.ValidationMessageFor(x => x.username)  
            </div>
        </div>
        <div class="control-group">
            @Html.LabelFor(x => x.email,new { @class = "control-label" })
            <div class="controls">
                @Html.TextBoxFor(x => x.email)
                @Html.ValidationMessageFor(x => x.email)   
            </div>        
        </div>
        <div class="control-group">
            @Html.LabelFor(x => x.name,new { @class = "control-label" })
            <div class="controls">
                @Html.TextBoxFor(x => x.name)
            </div>        
        </div>
        <div class="control-group">
            @Html.LabelFor(x => x.last_name,new { @class = "control-label" })
            <div class="controls">
                @Html.TextBoxFor(x => x.last_name)     
            </div>
        </div>
        <div class="control-group">
            @Html.LabelFor(x => x.password,new { @class = "control-label" })
            <div class="controls">
                @Html.PasswordFor(x => x.password)   
                @Html.ValidationMessageFor(x => x.password)     
            </div>        
        </div>            
        <br />
        <button type="submit" class="btn btn-primary">@Messages.ButtonCreate</button>
        <a class="btn" href="@Url.Action("Index", "User")">@Messages.ButtonCancel</a>
    </fieldset>
}